<extend name="Public/usercenter"/>

<block name="body">
    <div class="uc_care common_block_border clearfix mt_0" style="min-height:466px;padding-top: 20px;padding-bottom: 20px">
            <div class="col-xs-12 clearfix">
                <h4 style="margin-bottom: 6px;">消息中心</h4>
                <hr class="oneuser-title-hr"/>

                <ul class="nav nav-pills ucenter-tab" style="float: left">
                    <li
                    <eq name="tab" value="unread"> class="active"</eq>
                    ><a href="{:U('Usercenter/Message/message',array('tab'=>'unread'))}">未读消息</a></li>
                    <li
                    <eq name="tab" value="all"> class="active"</eq>
                    ><a href="{:U('Usercenter/Message/message',array('tab'=>'all'))}">全部消息</a></li>
                    <li
                    <eq name="tab" value="system"> class="active"</eq>
                    ><a href="{:U('Usercenter/Message/message',array('tab'=>'system'))}">系统消息</a></li>
                    <li
                    <eq name="tab" value="follow"> class="active"</eq>
                    ><a href="{:U('Usercenter/Message/message',array('tab'=>'follow'))}">膜拜消息</a></li>
                    <li
                    <eq name="tab" value="help"> class="active"</eq>
                    ><a href="{:U('Usercenter/Message/message',array('tab'=>'help'))}">求帮忙消息</a></li>
                    <li
                    <eq name="tab" value="talk"> class="active"</eq>
                    ><a href="{:U('Usercenter/Message/message',array('tab'=>'talk'))}">悄悄话消息</a></li>
                </ul>
                <div style="float: right;padding: 10px;"><a onclick="setAllReaded('{$tab}')" class="set_read" title="全部标为已读">全部标为已读</a></div>
            </div>
        <if condition="count($messages) eq 0"><p class="text-muted" style="text-align: center; font-size: 3em;">
            <br><br>
            该分类暂无消息～
            <br><br><br>
        </p></if>
        <volist name="messages" id="message">
            <div class="message-body clearfix">
                <div class="col-xs-2">
                    <div class="message_icon">
                        <img style="width: 55%;" class="avatar-img" ucard="{$message.from_uid}"
                             src="{$message.from_user.avatar64}"><br/>
                        {$message.from_user.space_link}
                    </div>
                </div>
                <div class="col-xs-10">
                    <dl>
                        <dt>
                            <div class="col-xs-9"><a href="{$message.url}">{$message.title}</a>
                                <eq name="message.is_read" value="0"><span class="badge-primary">未读</span></eq>
                                <!--<if condition=" ($message['apptype'] neq '')">
                                    <if condition=" ($message['appname'] neq '')  AND ($message['talk_id'] eq 0)">
                                        <a href="{:U('UserCenter/Message/talk',array('message_id'=>$message['id']))}"></a>
                                        <else/>
                                        <a href="{:U('UserCenter/Message/talk',array('talk_id'=>$message['talk_id']))}">
                                            <span class="badge-success">继续对话</span>
                                        </a>
                                        <a href="{:U('UserCenter/Message/doDeleteTalk',array('talk_id'=>$message['talk_id']))}" class="ajax-post" data-confirm="您确实要删除该聊天吗？">
                                            <span class="badge-danger">删除</span>
                                        </a>
                                    </if>
                                    <else/>
                                </if>-->
                            </div>
                            <div class="col-xs-3 message-ctime">{$message.create_time|friendlyDate}</div>
                        </dt>
                        <dd>{$message.content}</dd>
                    </dl>
                </div>
            </div>
        </volist>
        <div class="pull-right">
            {:getPagination($totalCount)}
        </div>
    </div>
</block>